package com.mew.chess.core.game.pokdeng;


import com.mew.chess.core.common.handler.ChessHandlerMapCmdType;
import com.mew.chess.core.common.handler.ChessPlayAnnotation;
import com.mew.chess.core.common.handler.GiftHandler;
import com.mew.chess.core.game.lh.game.LhGameManager;
import com.mew.chess.core.game.pokdeng.game.PokDengGameManager;
import com.mew.common.rest.bo.GameSession;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;


@Service
@Slf4j
@ChessPlayAnnotation(ChessHandlerMapCmdType.PokDengGift)
public class PokDengGiftHandler extends GiftHandler {

    public long[][] giftGold = {
            {300,500,600,100,1200,200},
            {0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0}
    };

    @Override
    public long getGiftGold(int type, int idx) {
        return giftGold[type][idx];
    }

    @Override
    public List<GameSession> getSessions(int roomId, int tableId) {
        List<GameSession> list = PokDengGameManager.getInstance().getController(roomId).getTableManager(tableId).getOnlineUser().values().stream().collect(Collectors.toList());
        return list;
    }
}
